package com.jwdf.uda.http.action;

import android.content.Context;
import com.jwdf.uda.bean.PbBean;
import com.jwdf.uda.http.AHttpService;
import com.jwdf.uda.http.ApiService;
import retrofit2.Call;

/**
 * 类说明：
 * 作者：huangqiuxin on 2016/5/14 14:27
 * 邮箱：648859026@qq.com
 */
public class GuideSetPublicAction extends AHttpService<PbBean.PbResGuideSetPublic>{
    /**
     *  搭配指导设置公开
     * @param context
     * @param id 指导ID
     * @param isPublic 是否公开
     * @return
     */
    public static GuideSetPublicAction newInstance(Context context, int id, boolean isPublic){
        return new GuideSetPublicAction(context, id, isPublic);
    }
    private int id;
    private boolean isPublic;
    private GuideSetPublicAction(Context context, int id, boolean isPublic) {
        super(context);
        this.id = id;
        this.isPublic = isPublic;
    }

    @Override
    protected Call newRetrofitCall(ApiService apiService, PbBean.PbBaseClientInfo.Builder baseBuilder) {
        PbBean.PbReqGuideSetPublic.Builder builder = PbBean.PbReqGuideSetPublic.newBuilder();
        builder.setBaseClientInfo(baseBuilder);
        builder.setId(id);
        builder.setIsPublic(isPublic);

        return apiService.guideSetPublic(builder.build());
    }
}
